import request from '@/utils/request';
import { unionApiUrl } from '@/api/config.js';
const apiRul = unionApiUrl;
// const apiRul = process.env.NODE_ENV == 'development' ? '/union-producer-server-yuantao' : unionApiUrl;
/**
 * 根据管理权限查询团组织机构树
 * @param data
 */
export function queryTreeList(data){
  return request({
    url: `${apiRul}/youthOrganization/queryTreeList`,
    method: 'post',
    data: data
  })
}

/**
 * 查询当前登录人的团组织等级
 * @param data
 */
export function queryOrgTypeByParentId(data){
  return request({
    url: `${apiRul}/youthOrganization/queryOrgTypeByParentId`,
    method: 'get',
    params: data
  })
}

/**
 * 添加团员组织机构
 * @param data
 */
export function insertSelective(data){
  return request({
    url: `${apiRul}/youthOrganization/insertSelective`,
    method: 'post',
    data: data
  })
}

/**
 * 组织信息列表分页查询
 * @param data
 */
export function getPartyOrgByIdAndSearch(data){
  return request({
    url: `${apiRul}/youthOrganization/getPartyOrgByIdAndSearch`,
    method: 'post',
    data: data
  })
}

/**
 * 获取团组织机构信息（编辑接口）
 * @param data
 */
export function getYouthOrganizationById(params){
  return request({
    url: `${apiRul}/youthOrganization/getYouthOrganizationById`,
    method: 'get',
    params
  })
}

/**
 * 条件查询团员信息
 * @param data
 */
export function queryAllYouthMemberList(data){
  return request({
    url: `${apiRul}/youthMember/queryAllYouthMemberList`,
    method: 'post',
    data: data
  })
}

/**
 * 组织信息设置
 * @param data
 */
export function updateByPrimaryKeySelective(data){
  return request({
    url: `${apiRul}/youthOrganization/updateByPrimaryKeySelective`,
    method: 'post',
    data: data
  })
}

/**
 * 撤销团员组织机构对象
 * @param data
 */
export function cancelByPrimaryKey(data){
  return request({
    url: `${apiRul}/youthOrganization/cancelByPrimaryKey`,
    method: 'post',
    data: data
  })
}

/**
 * 获取团员组织机构信息（查看接口）
 * @param data
 */
export function getPartyOrgAllById(data){
  return request({
    url: `${apiRul}/youthOrganization/getPartyOrgAllById`,
    method: 'get',
    params: data
  })
}

/**
 * 团员分页查询
 * @param data
 */
export function getPageYouthMember(data){
  return request({
    url: `${apiRul}/youthMember/getPageYouthMember`,
    method: 'post',
    data: data
  })
}

/**
 * 添加团员信息
 * @param data
 */
export function addYouthMember(data){
  return request({
    url: `${apiRul}/youthMember/insertSelective`,
    method: 'post',
    data: data
  })
}

/**
 * 修改团员信息
 * @param data
 */
export function updatePartyMember(data){
  return request({
    url: `${apiRul}/youthMember/updateByPrimaryKeySelective`,
    method: 'post',
    data: data
  })
}

/**
 * 更新团费缴至时间
 * @param data
 */
export function updateDuesEndTime(data){
  return request({
    url: `${apiRul}/youthMember/updateDuesEndTime`,
    method: 'post',
    data: data
  })
}

/**
 * 获取团员信息信息
 * @param data
 */
export function getYouthMemberById(data){
  return request({
    url: `${apiRul}/youthMember/getYouthMemberById`,
    method: 'get',
    params: data
  })
}
/**
 * 团员对内转出流程详情
 * @param data
 */
export function getYouthMemberBybusinessId(data){
  return request({
    url: `${apiRul}/youthMember/youthMemberInfoById`,
    method: 'get',
    params: data
  })
}
/**
 * 团员缴费记录分页查询
 * @param data
 */
export function getPagePartyMemberDues(data){
  return request({
    url: `${apiRul}/partyMemberDues/getPagePartyMemberDues`,
    method: 'post',
    data: data
  })
}

/**
 * 团员发展记录分页查询
 * @param data
 */
export function getPagePartyMemberDevelopment(data){
  return request({
    url: `${apiRul}/partyMemberDevelopment/getPagePartyMemberDevelopment`,
    method: 'post',
    data: data
  })
}

/**
 * 添加团费收缴记录
 * @param data
 */
export function memberDuesInsertSelective(data){
  return request({
    url: `${apiRul}/partyMemberDues/insertSelective`,
    method: 'post',
    data: data
  })
}

/**
 * 获取团费收缴记录信息
 * @param data
 */
export function getPartyMemberDuesById(data){
  return request({
    url: `${apiRul}/partyMemberDues/getPartyMemberDuesById`,
    method: 'get',
    params: data
  })
}

/**
 * 修改团费收缴记录信息
 * @param data
 */
export function updateMemberDues(data){
  return request({
    url: `${apiRul}/partyMemberDues/updateByPrimaryKeySelective`,
    method: 'post',
    data: data
  })
}

/**
 * 删除团费收缴记录
 * @param data
 */
export function deleteMemberDues(data){
  return request({
    url: `${apiRul}/partyMemberDues/deleteByPrimaryKey`,
    method: 'post',
    data: data
  })
}


/**
 * 添加团员发展记录
 * @param data
 */
export function memberDevelopmentInsertSelective(data){
  return request({
    url: `${apiRul}/partyMemberDevelopment/insertSelective`,
    method: 'post',
    data: data
  })
}

/**
 * 修改团员发展记录
 * @param data
 */
export function updateByPartyMemberDevelopment(data){
  return request({
    url: `${apiRul}/partyMemberDevelopment/updateByPrimaryKeySelective`,
    method: 'post',
    data: data
  })
}

/**
 * 删除团员发展记录
 * @param data
 */
export function deleteDevelopment(data){
  return request({
    url: `${apiRul}/partyMemberDevelopment/deleteByPrimaryKey`,
    method: 'post',
    data: data
  })
}


/**
 * 获取团员发展记录信息
 * @param data
 */
export function getPartyMemberDevelopmentById(data){
  return request({
    url: `${apiRul}/partyMemberDevelopment/getPartyMemberDevelopmentById`,
    method: 'get',
    params: data
  })
}

/**
 * 查询可添加为团员的员工
 * @param data
 */
export function getPartyMemberByUserOrgId(data){
  return request({
    url: `${apiRul}/youthMember/getPartyMemberByUserOrgId`,
    method: 'post',
    data: data
  })
}

/**
 * 团员对内转出
 * @param data
 */
export function inwardTransfer(data){
  return request({
    url: `${apiRul}/youthMember/inwardTransfer`,
    method: 'post',
    data: data
  })
}

/**
 * 团员对外转出
 * @param data
 */
export function transferOut(data){
  return request({
    url: `${apiRul}/youthMember/transferOut`,
    method: 'post',
    data: data
  })
}





